package org.masterview.user.client.ui;

import com.google.gwt.user.client.ui.SourcesTableEvents;
import com.google.gwt.user.client.ui.TableListener;

public class SorterTableListener implements TableListener
{
    protected Grid grid;

    public Grid getGrid() {
        return grid;
    }

    public void setGrid(Grid grid) {
        this.grid = grid;
    }

    public SorterTableListener(Grid grid) {
        this.grid = grid;
    }

    public void onCellClicked(SourcesTableEvents sourcesTableEvents, int row, int column) {
        if (row >= 1) {
            return;
        }

        grid.sortColumn(column);
    }
}
